//
//  JSReaderPageViewController.m
//  NiubilityProject
//
//  Created by Apple on 2018/5/25.
//  Copyright © 2018年 Apple. All rights reserved.
//

#import "JSReaderPageViewController.h"

@interface JSReaderPageViewController ()

@end

@implementation JSReaderPageViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
//    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(touchTap:)];
//
//    [self.view addGestureRecognizer:tap];
}

- (void)touchTap:(UITapGestureRecognizer *)tap {
    CGPoint touchPoint = [tap locationInView:self.view];
    if (touchPoint.x > SCREEN_WIDTH / 3 && touchPoint.x < (SCREEN_WIDTH - SCREEN_WIDTH / 3)){
        if ([self.readerDelegate respondsToSelector:@selector(tapCenterClick:)]) {
            [self.readerDelegate tapCenterClick:touchPoint];
        }
    }else if (touchPoint.x < SCREEN_WIDTH / 3){
        if ([self.readerDelegate respondsToSelector:@selector(upViewController)]) {
            [self.readerDelegate upViewController];
        }
    }else if (touchPoint.x > (SCREEN_WIDTH - SCREEN_WIDTH / 3)){
        if ([self.readerDelegate respondsToSelector:@selector(nextViewController)]) {
            [self.readerDelegate nextViewController];
        }
    }
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
